Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dh): apollo data source #3517

Merged
merged 47 commits into from
Sep 19, 2024
Merged

feat(dh): apollo data source #3517

merged 47 commits into from
Sep 19, 2024

Conversation

ManBearTM
Copy link
Contributor

@ManBearTM ManBearTM commented Sep 10, 2024

Description

This PR introduces the new ApolloDataSource, which is a Material DataSource implementation that is meant to be used with the new auto-generated DataSource classes. When you add UsePaging and UseSorting to a list query in the BFF (and update the related .graphql operation file), a corresponding DataSource class will be generated in the graphql.ts file. For example, if you were to add paging and sorting to the gridAreas query, a new class named GetGridAreasDataSource will be available in graphql.ts. This can be used directly with watt-table to get a fully server-side paginated and sort enabled table. The DataSource also enables the filter function (search field in the table). Just add a string parameter named filter to the paginated query in the BFF.

The PR also implements this new functionality for the calculations table. Since that table is now fully server-side paginated, I had to make some changes to the subscription part. It ended up simplifying the logic quite a bit, with the only caveat that calculations that others create are not automatically added to the list (this might not even be a bad thing). Instead we use refetchQueries now when you create a new calculation.

References

Copy link

nx-cloud bot commented Sep 10, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 82b4764. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 3 targets

Sent with 💌 from NxCloud.

@ManBearTM ManBearTM changed the title Save working state feat(dh): apollo data source Sep 10, 2024
Copy link
Contributor

github-actions bot commented Sep 10, 2024

Test results for \apps\dh\api-dh\source\DataHub.WebApi.Tests\bin\Release\net8.0\Energinet.DataHub.WebApi.Tests.dll

1 tests   1 ✅  2m 42s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit edaa4e6.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mimse mimse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: Looks great, not understanding all of it :P

@ManBearTM ManBearTM merged commit f2efb6d into main Sep 19, 2024
34 checks passed
@ManBearTM ManBearTM deleted the feat/apollo-data-source branch September 19, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor watt-paginator to use signals
2 participants